package com.ruoyi.system.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;

import java.util.Date;

/**
 * 学生课堂互动记录对象 sys_student_interaction
 *
 * @author ruoyi
 * @date 2025-08-29
 */
@Data
public class SysStudentInteraction extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键ID */
    private Long id;

    /** 用户ID（关联用户表） */
    private Long userId;

    /** 课程ID（关联课程表） */
    @Excel(name = "课程ID")
    private Long courseId;

    /** 课程名称 */
    @Excel(name = "课程名称")
    private String courseName;

    /** 互动类型：1-提问 2-回答 3-讨论 4-投票 5-签到 */
    @Excel(name = "互动类型", readConverterExp = "1=提问,2=回答,3=讨论,4=投票,5=签到")
    private Integer interactionType;

    /** 互动内容 */
    @Excel(name = "互动内容")
    private String interactionContent;

    /** 互动时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "互动时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date interactionTime;

    /** 获得的积分奖励 */
    @Excel(name = "获得的积分奖励")
    private Integer scoreRewarded;

    /** 状态：0-无效 1-有效 */
    @Excel(name = "状态", readConverterExp = "0=无效,1=有效")
    private Integer status;

    /**
     * 获取互动类型描述
     */
    public String getInteractionTypeDesc() {
        if (interactionType == null) {
            return "";
        }
        switch (interactionType) {
            case 1: return "提问";
            case 2: return "回答";
            case 3: return "讨论";
            case 4: return "投票";
            case 5: return "签到";
            default: return "未知";
        }
    }
}
